package All.Mapper;

import java.sql.Connection;
import All.connectionDB.ConnectionService;

public class MapperDB {
	private Connection connection;
	
	public MapperDB() throws Exception {
		try {
			connection = ConnectionService.getConnection();
		}
		catch (Exception e) {
			System.out.println(e.toString());
			throw e;
		}
	}
	
	public Connection getConnection() {
		return connection;
	}
	
	public void closeConnection() throws Exception {
		try {
			getConnection().close();
		}
		catch (Exception e) {
			System.out.println(e.toString());
			throw e;
		}
	}
}
